
enum FUN_LIST {
    //% block="红色"
     getRed,
    //% block="绿色"
     getGreen,
    //% block="蓝色"
     getBlue,
    //% block="白色"
     getWhite,
    //% block="环境光"
     getCCT
}

//% color="#5ba55b" iconWidth=50 iconHeight=40
namespace RGBW_VEML6040 { 

    //% block="读取RGBW颜色传感器的 [FUN]" blockType="reporter"
    //% FUN.shadow="dropdown" FUN.options="FUN_LIST" 
     export function read_ahtxx(parameter: any, block: any) {
        let fun = parameter.FUN.code;
        Generator.addInclude('#include_Wire_h>', '#include <Wire.h>');
        Generator.addInclude('#include_RL_AHTxx_h', '#include "RL_VEML6040.h"');
        Generator.addObject(`VEML6040_RGBWSensor`, `VEML6040 `, `RGBWSensor;`);
        Generator.addSetup(`RGBWSensor_begin`, `Wire.begin();\n  RGBWSensor.begin();\n`);
        Generator.addCode(`RGBWSensor.${fun}()`);
    }

   
}
